package com.jk.controller;

import com.jk.entity.StaffEntity;
import com.jk.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.List;
import java.util.logging.SimpleFormatter;

/**
 * @description:
 * @author: 马辉杰 
 * @date: 2022/11/2 20:56
 * @param: 
 * @return: 
 **/
@RestController
@RequestMapping("staff")
@CrossOrigin(origins = "*")
public class StaffController {


    @Autowired
    private StaffService staffService;

    /**
     * @Author 马辉杰
     * @Date 20:25 2022/11/2
     * @Param [staffEntity]
     * @return java.util.List<com.jk.entity.StaffEntity>
     *     全部员工
     **/
    @RequestMapping("staffFindAll")
    public List<StaffEntity> staffFindAll(StaffEntity staffEntity){
        return staffService.staffFindAll(staffEntity);
    }
    /**
     * @description:员工总数量
     * @author: mhj
     * @date: 2022/11/2 21:07
     * @param: [] 
     * @return: java.lang.Integer
     **/
    @RequestMapping("staffcount")
    public Integer staffcount(){
        return staffService.staffcount();
    }
    /**
     * @description:新增员工
     * @author: mhj
     * @date: 2022/11/3 14:02
     * @param: [staffEntity]
     * @return: void
     **/
    @RequestMapping("addstaff")
    public void addstaff(StaffEntity staffEntity){
        staffService.addstaff(staffEntity);
    }
    /**
     * @description:回显员工
     * @author: mhj
     * @date: 2022/11/3 21:08
     * @param: [staffEntity]
     * @return: com.jk.entity.StaffEntity
     **/
    @RequestMapping("stafffinfByid")
    public StaffEntity stafffinfByid(Integer id){
        return staffService.stafffinfByid(id);
    }
    /**
     * @description:删除员工
     * @author: mhj
     * @date: 2022/11/4 10:04
     * @param: [id]
     * @return: void
     **/
    @RequestMapping("stafffDelByid")
    public void stafffDelByid(Integer id){
        staffService.stafffDelByid(id);
    }








}
